package com.zhimu.boot.activemq.consumer;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * @Author: Alvin
 * @Date: 2019/6/23 16:43
 * @Description
 */
@Component
public class Queue_Consumer {

    @JmsListener(destination = "${myQueue}")
    public void receive(TextMessage textMessage) throws JMSException {
        System.out.println("*********消费者收到消息：" + textMessage.getText());
    }
}
